﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using YanZhiwei.DotNet2.Utilities.Enums;
namespace YanZhiwei.DotNet2.Utilities.Common.Tests
{
    [TestClass()]
    public class DateHelperTests
    {
        [TestMethod()]
        public void DateDiffTest()
        {
            DateTime _start = new DateTime(2014, 12, 12);
            DateTime _end = new DateTime(2014, 12, 24);
            int _actual = DateHelper.DateDiff(_start, _end, DatePart.day);
            Assert.AreEqual(12, _actual);
        }

        [TestMethod()]
        public void GetDaysTest()
        {
            DateTime _time = new DateTime(2014, 12, 24);
            int _actual = DateHelper.GetDays(_time);
            Assert.AreEqual(31, _actual);
        }
    }
}
